home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / emacs16d.zip / _KILLS.MIN < prev    next >
Text File  |  1991-07-19  |  7KB  |  394 lines

  1.  
  2.  
  3.  
  4. Name:F:append-next-kill
  5. Causes the next kill to be appended to the previous kill string.
  6. [*]kill[*]
  7.  
  8.  
  9. Name:F:backward-kill-sentence
  10. CAUTION: (forward-sentence) seems to be broken!
  11. [*]    
  12. #(Fkill-do,F:backward-sentence,(arg1))
  13. [*]
  14.  
  15.  
  16. Name:F:backward-kill-word
  17. [*]    
  18. #(Fkill-do,F:backward-word,(arg1),backward-)
  19. [*]
  20.  
  21.  
  22. Name:F:copy-region-as-kill
  23. The contents of the region are copied to the kill ring.
  24. MODIFIED BY APN -
  25. There was a bug in the original procedure in that when the command previous
  26. to copy-region was a kill, the copy-region would insert the previous kill
  27. into the current  buffer location. The code below corrects for this. If the
  28. previous command was a kill, (indicated by ##(result) == kill), then the new
  29. code is used, else the old code is used. The new code actually works for all
  30. cases but we use it only when necessary so that we do not unnecessarily
  31. insert into the buffer before the kill (this  matters only for large regions
  32. where there might not be enough string space).
  33. [*]kill
  34. #(sv,mb,#(lv,mb),
  35.     #(mb,#(Fmark),(#(ds,xSELF)))
  36.     #(==,##(result),kill,(
  37.         #(is,
  38.             ##(rm,#(Fmark),(#(an,No String Space!)))
  39.             #(..,#(Fkill,#(Fmark)))
  40.             #(F:swap-point-and-mark)
  41.         )
  42.     ),(
  43.         #(Fkill,#(Fmark))
  44.         #(F:un-kill)
  45.         #(n?,xSELF,,(#(F:swap-point-and-mark)))
  46.     ))
  47.     #(es,xSELF)
  48. )[*]
  49.  
  50.  
  51. Name:F:delete-backward-char
  52. Delete the character before the point.
  53. [*]    
  54. #(==,arg1,,(#(dm,<)),(
  55.     #(Fkill-do,F:backward-char,(arg1),backward-)
  56. ))[*]
  57.  
  58.  
  59. Name:F:delete-blank-lines
  60. Delete all but one of many consecutive blank lines.
  61. [*]#(pm,1)
  62. #(==,##(rm,^)##(rm,$),,(
  63.     #(Fwhile-yes,(
  64.         #(==,##(rc,<),0,,(
  65.             #(sp,<)
  66.             #(==,##(rc,^),0,(
  67.                 ##(dm,>)
  68.                 yes
  69.             ))
  70.         ))
  71.     ))
  72. ))
  73. #(sp,0$)
  74. #(Fwhile-yes,(
  75.     #(==,##(rc,>),0,,(
  76.         #(sp,>)
  77.         #(==,##(rc,$),0,(
  78.             #(dm,<)
  79.             yes
  80.         ))
  81.     ))
  82. ))
  83. #(sp,0)
  84. #(pm)
  85. [*]
  86.  
  87.  
  88. Name:F:delete-char
  89. The character to the right of the point is deleted.
  90. [*]    
  91. #(==,arg1,,(#(dm,>)),(
  92.     #(Fkill-do,F:forward-char,(arg1))
  93. ))[*]
  94.  
  95.  
  96. Name:F:delete-horizontal-space
  97. Kill newlines only if there's an argument. (More like GNU emacs.)
  98. [*]#(pm,2)
  99. #(lp,[ ##(bc,9,d,a)]*,,r)
  100. #(l?,.,[,0)
  101. #(l?,.,],,1)
  102. #(sp,0)
  103. #(dm,1)
  104. #(pm)
  105. [*]
  106.  
  107.  
  108. Name:F:delete-indentation
  109. [*]#(Fsave-excursion,(
  110.     #(sp,^)
  111.     #(F:delete-horizontal-space)
  112.     #(dm,<)
  113.     #(==,##(rc,^),0,,(
  114.         #(==,##(rm,<),##(bc,40,d,a),,(
  115.             #(==,##(rm,>),##(bc,41,d,a),,(
  116.                 #(is, )
  117.             ))
  118.         ))
  119.     ))
  120. ))[*]
  121.  
  122.  
  123. Name:F:just-one-space
  124. [*]#(F:delete-horizontal-space)
  125. #(is, )[*]
  126.  
  127.  
  128. Name:F:kill-comment
  129. Delete the comment on this line.
  130. [*]    
  131. #(pm,2)
  132. #(lp,##(F-left-comment))
  133. #(l?,^,$,0,,(
  134.     #(lp,##(F-right-comment))
  135.     #(l?,0,$,,1,(
  136.         #(sp,0)
  137.         #(==,##(rc,^),0,,(
  138.             #(Ffind-non-blank,<,^)
  139.             #(dm,0)
  140.         ))
  141.         #(Fkill,1)
  142.     ))
  143. ))
  144. #(pm)
  145. #(==,arg1,,,(
  146.     #(sp,$>)
  147. ))
  148. #(g?,arg1,1,(
  149.     #(SELF,##(--,arg1,1))
  150. ))
  151. [*]
  152.  
  153.  
  154. Name:F:kill-line
  155. [*]    
  156. #(Fkill-do,Fkill-line,(arg1))
  157. [*]
  158.  
  159.  
  160. Name:F:kill-region
  161. Kill the text between point and mark.
  162. [*]#(Fkill,#(Fmark))[*]
  163.  
  164.  
  165. Name:F:kill-sentence
  166. [*]    
  167. #(Fkill-do,F:forward-sentence,(arg1))
  168. [*]
  169.  
  170.  
  171. Name:F:kill-spaces
  172. Kill space on either side of point.
  173. [*]#(Fmark-whitespace)
  174. #(F:kill-region)
  175. [*]
  176.  
  177.  
  178. Name:F:kill-word
  179. [*]    
  180. #(Fkill-do,F:forward-word,(arg1))
  181. [*]
  182.  
  183.  
  184. Name:F:un-kill
  185. Bring something back from the kill ring.
  186. [*]#(pm,1)
  187. #(is,!)
  188. #(sm,0,<)
  189. #(Fun-kill-from-buffer-one,##(++,##(Fkill.head),48))
  190. #(Fset-new-mark,.)
  191. #(sp,0)
  192. #(dm,>)
  193. #(sm,0)
  194. #(sp,#(Fmark))
  195. #(sm,#(Fmark),0)
  196. #(pm)
  197. [*]
  198.  
  199.  
  200. Name:F:un-kill-pop
  201. Replace the previously un-kill'ed text with the previous kill ring entry.
  202. [*]#(==,##(rc,#(Fmark)),
  203.     #(ds,old-buffer,##(ba,-1))
  204.     #(..,##(ba,1,a))
  205.     #(sp,##(bc,##(++,#(Fkill.head),48),d,a)>)
  206.     ##(rc,##(bc,##(++,#(Fkill.head),49),d,a))
  207.     #(..,##(ba,##(old-buffer)))
  208. ,(
  209.     #(dm,#(Fmark))
  210.     #(Funrotate,Fkill)
  211.     #(F:un-kill)
  212. ),(
  213.     #(Fmessage,Yank something first!)
  214. ))[*]
  215.  
  216.  
  217. Name:F:zap-to-char
  218. Prompts for a character and deletes the text between the point and the
  219. first occurence of this char.
  220. [*]    
  221. #(an,#(Fsignum,(arg1),Z,Backward z)ap to char
  222.     ##(Fparens,#(Fmodulus,(arg1))):)
  223. #(rd)
  224. #(Fvalid-key,(
  225.     #(Fzap-to-char,(##(gs,is-Fvalid-key)),(arg1))
  226. ))
  227. #(an)
  228. [*]
  229.  
  230.  
  231. Name:Fbackward-delete-whitespace
  232. Delete whitespace to the left of point.
  233. [*]#(sp,<)
  234. #(Fwhitespace,(
  235.     #(dm,>)
  236.     #(SELF)
  237. ),(
  238.     #(sp,>)
  239. ))[*]
  240.  
  241.  
  242. Name:Fbackward-kill
  243. Delete characters to the left of point.  This is needed so that repeated kills
  244. get placed in the correct order.
  245. [*]kill
  246. #(==,##(result),kill,,(
  247.     #(Frotate,Fkill)
  248. ))
  249. #(Fkill-to-buffer-one,
  250.     #(++,#(Fkill.head),48)
  251. ,
  252.     arg1
  253. ,
  254.     #(==,##(result),kill,backward,new)
  255. )
  256. #(dm,arg1)
  257. [*]
  258.  
  259.  
  260. Name:Fdelete-n-chars
  261. [*]#(ds,temp,(arg2))
  262. #(..,##(gn,temp,arg1))
  263. ##(temp)(,)[*]
  264.  
  265.  
  266. Name:Fkill
  267. Kill to a given mark.
  268. [*]kill
  269. #(==,##(result),kill,,(
  270.     #(Frotate,Fkill)
  271. ))
  272. #(Fkill-to-buffer-one,
  273.     #(++,#(Fkill.head),48)
  274. ,
  275.     arg1
  276. ,
  277.     #(==,##(result),kill,forward,new)
  278. )
  279. #(dm,arg1)
  280. [*]
  281.  
  282.  
  283. Name:Fkill-buffer
  284. Kill the current buffer.
  285. [*]#(sv,mb,0)
  286. #(sp,[)
  287. #(dm,])
  288. #(an)
  289. #(ds,buffer-free.##(ba,-1))
  290. #(ds,minor-modes.##(ba,-1))
  291. #(mp,last-buffer,,@##(buffer-number.##(ba,-1))(,))
  292. #(Fbuffer-set-fn)
  293. #(ds,temp,#(Ffirst,#(last-buffer)))
  294. #(..,##(go,temp))
  295. #(ds,temp,##(buffer-name.##(temp)))
  296. #(g?,##(temp),0,(
  297.     #(==,##(ba,##(temp)),0,(
  298.         #(Fmessage,No such buffer)
  299.     ))
  300.     #(Fenter-local-modes)
  301. ),(
  302.     #(Ffind-or-make-buffer,*scratch*)
  303. ))[*]
  304.  
  305.  
  306. Name:Fkill-do
  307. Arg1 is the function to move over the text, and arg2 is the count.
  308. Arg3 is either "backward-" or it is null.
  309. [*]
  310. #(pm,1)
  311. #(arg1,(arg2))
  312. #(Farg3kill,0)#(pm)
  313. [*]
  314.  
  315.  
  316. Name:Fkill-line
  317. Move to the end of the current line.
  318. [*]#(==,arg1,,(
  319.     #(==,##(rm,>),(
  320. ),(
  321.         #(sp,>)
  322.     ),(
  323.         #(sp,$)
  324.     ))
  325. ),(
  326.     #(sp,^#(Floop,#(Fsignum,(arg1),$>,<^),#(Fmodulus,(arg1))))
  327. ))[*]
  328.  
  329.  
  330. Name:Fkill-to-buffer-one
  331. Given
  332. arg1 = ASCII value of mark in buffer one,
  333. arg2 = mark in current buffer to kill to.
  334. arg3 = new if this is a new mark,
  335.        forward if we should apppend to right of previous, and
  336.        backward if we should prepend to left of previous.
  337.  
  338. [*]#(ds,old-buffer,##(ba,-1))
  339. #(..,##(ba,1,a))
  340. #(Fcase,arg3,
  341.     (new,(
  342.         #(sp,##(bc,arg1,d,a)>)
  343.         #(dm,##(bc,##(++,arg1,1),d,a))
  344.     )),
  345.     (forward,(
  346.         #(sp,##(bc,##(++,arg1,1),d,a))
  347.     )),
  348.     (backward,(
  349.         #(sp,##(bc,arg1,d,a)>)
  350.     )),
  351.     (#(bl))
  352. )
  353. #(bi,##(old-buffer),arg2)
  354. #(..,##(ba,##(old-buffer)))
  355. [*]
  356.  
  357.  
  358. Name:Fkill.head
  359. current entry in kill ring.
  360. [*]3[*]
  361.  
  362.  
  363. Name:Fkill.size
  364. maximum number of entries in the kill ring.
  365. [*]8[*]
  366.  
  367.  
  368. Name:Fun-kill-from-buffer-one
  369. Insert the text from buffer one found at the mark whose ASCII value is arg1.
  370. [*]#(..,##(ba,
  371.     ##(ba,-1)
  372.     #(..,##(ba,1,a))
  373.     #(sp,##(bc,arg1,d,a)>)
  374. ))
  375. #(bi,1,##(bc,##(++,arg1,1),d,a))
  376. [*]
  377.  
  378.  
  379. Name:Fzap-to-char
  380. [*]#(n?,Fkey2char.arg1,(
  381.     #(lp,#(Fkey2char.arg1))
  382. ),(
  383.     #(lp,arg1)
  384. ))
  385. #(pm,2)
  386. #(Fsignum,(arg2),(
  387.     #(Floop,(#(l?,.,],,1,(#(sp,1)),(#(sp,])))),#(Fmodulus,(arg2)))
  388.     #(sp,<)
  389. ),(
  390.     #(Floop,(#(l?,.,[,1,,(#(sp,1)),(#(sp,[)))),#(Fmodulus,(arg2)))
  391.     #(sp,>)
  392. ))
  393. #(Fkill,0)
  394. #(pm)[*]